{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import DataSetQuery\n",
    "import datetime\n",
    "\n",
    "#Sets the URL of the Malard ServiceGateway.\n",
    "query = DataSetQuery.DataSetQuery('http://localhost:9000')\n",
    "\n",
    "#Sets the output directory for all users of the server.\n",
    "#query.createEnvironment('DEV','/data/puma1/scratch/malard/export/','/data/puma1/scratch/malard/mask/','/data/snail1/scratch/malard/points/')\n",
    "#query.createEnvironment('JALOCAL','C:\\\\Earthwave\\\\malard\\\\export\\\\','C:\\\\Earthwave\\\\malard\\\\masks\\\\','C:\\\\Earthwave\\\\malard\\\\Points\\\\')\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"name\":\"DEV\",\"maskPublisherPath\":\"/data/puma1/scratch/malard/mask/\",\"cacheCdfPath\":\"/data/puma1/scratch/malard/export/\",\"pointCdfPath\":\"/data/snail1/scratch/malard/points/\"}\n",
      "{\"name\":\"JALOCAL\",\"maskPublisherPath\":\"C:\\\\Earthwave\\\\malard\\\\masks\\\\\",\"cacheCdfPath\":\"C:\\\\Earthwave\\\\malard\\\\export\\\\\",\"pointCdfPath\":\"C:\\\\Earthwave\\\\malard\\\\Points\\\\\"}\n",
      "{\"shortName\":\"HMA\",\"proj4\":\"+proj=aea +lat_1=25 +lat_2=47 +lat_0=36 +lon_0=85 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs\"}\n"
     ]
    }
   ],
   "source": [
    "\n",
    "print( query.getEnvironment('DEV'))\n",
    "print( query.getEnvironment('JALOCAL'))\n",
    "\n",
    "print( query.getProjection('HMA'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "projections = { 'NPS':  '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs',\n",
    "                'HMA': '+proj=aea +lat_1=25 +lat_2=47 +lat_0=36 +lon_0=85 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs',\n",
    "                'PAT': '+proj=aea +lat_1=-55 +lat_2=-45 +lat_0=-50 +lon_0=-70 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_def',\n",
    "                'APS': '+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'\n",
    "              }\n",
    "\n",
    "for shortName, proj4 in projections.items():\n",
    "    print(query.publishProjection(shortName, proj4))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
